package com.xhtt.modules.gathering.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang.StringUtils;

import java.util.Date;

/**
 * 收费单管理列表数据
 * ClassName: ChargesListModel
 *
 * @Date 2018-09-30 下午 4:44
 */
public class ChargesListModel {

    private int id;
    /**
     * 评审编号
     */
    private String reviewNumber;

    /**
     * 申请等级
     */
    private String applyLevel;

    /**
     * 申请类型
     */
    private String applyType;

    /**
     * 费用类型
     */
    private String costType;

    /**
     * 企业名称
     */
    private String name;

    /**
     * 收款凭证
     */
    private String gatheringFile;
    /**
     * 费用金额
     */
    private String cost;

    /**
     * 收款金额
     */
    private Double gathering;

    /**
     * 到账账户
     */
    private String account;

    /**
     * 税号
     */
    private String invoiceParagraph;

    /**
     * 快递号
     */
    private String expressNumber;

    /**
     * 到账情况
     */
    private String accountSituation;

    /**
     * 收费方式
     */
    private String mtc;

    /**
     * 开票状态
     */
    private String invoiceState;

    /**
     * 发票物流
     */
    private String expressState;

    /**
     * 评审时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date createTime;

    /**
     * 收款人用户名
     */
    private String gatheringUsername;

    /**
     * 开票人用户名
     */
    private String invoiceUsername;

    /**
     * 开票寄送人用户名
     */
    private String invoiceSendUsername;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getGatheringFile() {
        return gatheringFile;
    }

    public void setGatheringFile(String gatheringFile) {
        this.gatheringFile = gatheringFile;
    }

    public String getReviewNumber() {
        return reviewNumber;
    }

    public void setReviewNumber(String reviewNumber) {
        this.reviewNumber = reviewNumber;
    }

    public String getCostType() {
        return costType;
    }

    public void setCostType(String costType) {
        this.costType = costType;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCost() {
        return cost;
    }

    public void setCost(String cost) {
        this.cost = cost;
    }

    public Double getGathering() {
        return gathering;
    }

    public void setGathering(Double gathering) {
        this.gathering = gathering;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getInvoiceParagraph() {
        return invoiceParagraph;
    }

    public void setInvoiceParagraph(String invoiceParagraph) {
        this.invoiceParagraph = invoiceParagraph;
    }

    public String getExpressNumber() {
        return expressNumber;
    }

    public void setExpressNumber(String expressNumber) {
        this.expressNumber = expressNumber;
    }

    /**
     * 设置付款状态
     * 如果收款人用户名不为空,代表已收款
     *
     * @return
     */
    public String getAccountSituation() {
        if (StringUtils.isNotEmpty(this.gatheringUsername)) {
            return accountSituation = "已付款";
        } else {
            return accountSituation = "未付款";
        }
    }


    public String getMtc() {
        return mtc;
    }

    public void setMtc(String mtc) {
        this.mtc = mtc;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /**
     * 设置开票状态
     * 如果开票人不为空,代表已开票
     *
     * @return
     */
    public String getInvoiceState() {
        if (StringUtils.isNotEmpty(this.invoiceUsername)) {
            return invoiceState = "已开票";
        } else {
            return invoiceState = "未开票";
        }
    }

    /**
     * 设置寄送状态
     * 如果开票寄送人用户名不为空,代表已寄送
     *
     * @return
     */
    public String getExpressState() {
        if (StringUtils.isNotEmpty(this.invoiceSendUsername)) {
            return expressState = "已寄送";
        } else {
            return expressState = "未寄送";
        }
    }

    public String getApplyLevel() {
        return applyLevel;
    }

    public void setApplyLevel(String applyLevel) {
        this.applyLevel = applyLevel;
    }

    public String getApplyType() {
        return applyType;
    }

    public void setApplyType(String applyType) {
        this.applyType = applyType;
    }

    public String getGatheringUsername() {
        return gatheringUsername;
    }

    public void setGatheringUsername(String gatheringUsername) {
        this.gatheringUsername = gatheringUsername;
    }

    public String getInvoiceUsername() {
        return invoiceUsername;
    }

    public void setInvoiceUsername(String invoiceUsername) {
        this.invoiceUsername = invoiceUsername;
    }

    public String getInvoiceSendUsername() {
        return invoiceSendUsername;
    }

    public void setInvoiceSendUsername(String invoiceSendUsername) {
        this.invoiceSendUsername = invoiceSendUsername;
    }

    @Override
    public String toString() {
        return "ChargesListModel{" +
                "reviewNumber='" + reviewNumber + '\'' +
                ", applyLevel=" + applyLevel +
                ", applyType=" + applyType +
                ", name='" + name + '\'' +
                ", cost='" + cost + '\'' +
                ", gathering='" + gathering + '\'' +
                ", account='" + account + '\'' +
                ", invoiceParagraph='" + invoiceParagraph + '\'' +
                ", expressNumber='" + expressNumber + '\'' +
                ", accountSituation='" + accountSituation + '\'' +
                ", mtc='" + mtc + '\'' +
                ", invoiceState='" + invoiceState + '\'' +
                ", expressState='" + expressState + '\'' +
                ", reviewTime=" + createTime +
                '}';
    }
}
